package com.night.student.service.impl;

import com.night.common.entity.administration.Teacher;
import com.night.common.entity.student.Student;
import com.night.student.mapper.StudentMapper;
import com.night.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Mr.Wang
 * @ClassName: StudentServiceImpl
 * @Description: //TODO
 * @date: 2022/10/18-19:30
 */
@Service
public class StudentServiceImpl implements StudentService{
    @Autowired
    StudentMapper studentMapper;

    @Override
    public void add(Student student) {
        studentMapper.insert(student);
    }

    @Override
    public void update(Student student) {
        studentMapper.update(student);
    }

    @Override
    public void adds(List<Student> students) {
        studentMapper.adds(students);
    }

    @Override
    public Student getInfo(int id) {
        return studentMapper.getStudent(id);
    }

    @Override
    public Student getInfoByNumber(String studentNumber) {
        return studentMapper.getStudentByNumber(studentNumber);
    }

    @Override
    public List<Student> getByClassId(int classId) {
        return studentMapper.getByClassId(classId);
    }

    @Override
    public Teacher getByStudent(int id) {
        return studentMapper.getByStudent(id);
    }
}
